﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="RealizarOrdenCompra.aspx.cs" Inherits="SISLOG.Web.RealizarOrdenCompra" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style1
        {
            width: 93%;
        }
        .style2
    {
        width: 459px;
    }
        .style3
        {
            width: 170px;
        }
        .style4
        {
            width: 100px;
        }
        </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table class="style1">
    <tr>
        <td class="style2">
            <fieldset>
            <legend>Orden Compra</legend>
                <table>
                    <tr>
                        <td class="style3">
                            Id Orden Compra:
                        </td>
                        <td>
                        <asp:TextBox ID="idOrdenCompraTextBox" runat="server" 
                                Text='<%# Bind("idOrdenCompra") %>' Width="200px" />
                        <br />
                        </td>
                    </tr>
                    <tr>
                        <td class="style3">
                            Fecha Orden Compra:
                        </td>
                        <td>
                        <asp:TextBox ID="fechaOrdenCompraTextBox" runat="server" 
                                Text='<%# Bind("fechaOrdenCompra") %>' Width="200px" />
                        <br />
                        </td>
                    </tr>
                    <tr>
                        <td class="style3">
                            Responsable:
                        </td>
                        <td>
                        <asp:TextBox ID="responsableTextBox" runat="server" 
                                Text='<%# Bind("responsable") %>' Width="200px" />
                        <br />
                        </td>
                    </tr>
                </table>
            </fieldset>
        </td> 
        <td>
            <fieldset>
            <legend>Material</legend>
                <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                    <ContentTemplate>
                    <table style="width: 407px">
                    <tr>
                        <td class="style4">
                        Descripción:
                        </td>
                        <td style="margin-left: 120px">
                        <asp:TextBox ID="txtDescripcion" runat="server" 
                                Text='<%# Bind("descripcion") %>' Width="200px" />
                            &nbsp;&nbsp;&nbsp;
                            <asp:Button ID="btnBuscarMaterial" runat="server" Text="..." Height="26px" 
                                Width="40px" />
                            <ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server" 
                            PopupControlID="pnlMaterial" BackgroundCssClass="FondoAplicacion" TargetControlID="btnBuscarMaterial" OkControlID="btnAceptar" CancelControlID="btnCancelar">
                            </ajaxToolkit:ModalPopupExtender>
                        </td>
                    </tr>
                    <tr>
                        <td class="style4">
                        <br />
                        Cantidad:
                        <br />
                        <br />
                        </td>
                        <td>
                        <br />
                        <asp:TextBox ID="txtCantidad" runat="server" Width="200px"></asp:TextBox>                      
                            <asp:Button ID="btnAgregar" runat="server" onclick="btnAgregar_Click" 
                                Text="Agregar" />
                        <br />
                        </td>
                    </tr>
                </table>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="GridView1" 
                            EventName="SelectedIndexChanged" />
                    </Triggers>
                </asp:UpdatePanel>
                
            </fieldset>
        </td>       
    </tr>
</table>
    
<fieldset>
<legend>Detalle Orden De Compra</legend>
    <asp:UpdatePanel ID="udpDetalle" runat="server">
    <ContentTemplate>
    <asp:GridView ID="gvDetalle" runat="server" AutoGenerateColumns="False">
        <Columns>
                  <asp:BoundField DataField="IdDetalle" HeaderText="Id Detalle" />
                  <asp:BoundField DataField="Descripcion " HeaderText="Descripcion" />
                  <asp:BoundField DataField="Cantidad" HeaderText="Cantidad" />                       
        </Columns>
        </asp:GridView>
    </ContentTemplate>    
    </asp:UpdatePanel> 
</fieldset>
    <asp:Panel ID="pnlMaterial" runat="server" CssClass="CajaDialogo">
    <fieldset>
    <legend>Buscar Material</legend>
        <asp:RadioButton ID="RadioButton1" runat="server" Text="Descripción" 
            GroupName="Radio" />
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:RadioButton ID="RadioButton2" runat="server" Text="Proveedor" 
            GroupName="Radio"/>
    <br />
    <br />
    Buscar:&nbsp;&nbsp;&nbsp;    
    <asp:TextBox ID="txtCriterio" runat="server" Width="206px"></asp:TextBox>
    &nbsp;&nbsp;&nbsp;&nbsp;
    <asp:Button ID="botonBuscar" runat="server" Text="Buscar" 
            onclick="botonBuscar_Click" />
        <br />
    <br />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate> 
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            AllowPaging="True" AutoGenerateSelectButton="True" 
                    DataKeyNames="idMaterial" 
                    onselectedindexchanged="GridView1_SelectedIndexChanged">
        <Columns>
            <asp:BoundField DataField="idMaterial" HeaderText="Id Material" 
                SortExpression="idMaterial" />
            <asp:BoundField DataField="descripcion" HeaderText="Descripción" 
                SortExpression="descripcion" />
            <asp:BoundField DataField="Proveedor" HeaderText="Proveedor" 
                SortExpression="Proveedor" />
        </Columns>
    </asp:GridView>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="botonBuscar" EventName="Click" />
            </Triggers>
        </asp:UpdatePanel>
        <br />
        <asp:Button ID="btnAceptar" runat="server" Text="Aceptar" />
        <asp:Button ID="btnCancelar" runat="server" Text="Cancelar" 
            onclick="btnCancelar_Click" />
    </fieldset>        
    </asp:Panel>
</asp:Content>

